from conftest import login_token
import requests,pytest

class Test_address:
    def test_add_01(self,login_token):
        sessionId,userId=login_token

        url='http://10.59.9.18/small/user/verify/v1/addReceiveAddress'
        headers={
            'sessionId':str(sessionId),
            'userId':str(userId)
        }
        body={
            'realName':'张三',
            'phone': '17601535724',
            'address': '北京昌平',
            'zipCode': '101010',
        }
        r=requests.post(url=url,headers=headers,params=body)
        r_json=r.json()
        print(r_json)


    def test_add_02(self,login_token):
        sessionId,userId=login_token

        url='http://10.59.9.18/small/user/verify/v1/addReceiveAddress'
        headers={
            'sessionId':str(sessionId),
            'userId':str(userId)
        }
        body={
            'realName':'张三',
            'phone': '17601535724',
            'address': '北京昌平',
            'zipCode': '111',
        }
        r=requests.post(url=url,headers=headers,params=body)
        r_json=r.json()
        print(r_json)

    def test_add_03(self,login_token):
        sessionId,userId=login_token

        url='http://10.59.9.18/small/user/verify/v1/addReceiveAddress'
        headers={
            'sessionId':str(sessionId),
            'userId':str(userId)
        }
        body={
            'realName':'张三',
            'phone': '17601535724',
            'address': '',
            'zipCode': '101010',
        }
        r=requests.post(url=url,headers=headers,params=body)
        r_json=r.json()
        print(r_json)

    def test_add_04(self,login_token):
        sessionId,userId=login_token

        url='http://10.59.9.18/small/user/verify/v1/addReceiveAddress'
        headers={
            'sessionId':str(sessionId),
            'userId':str(userId)
        }
        body={
            'realName':'',
            'phone': '17601535724',
            'address': '北京昌平',
            'zipCode': '101010',
        }
        r=requests.post(url=url,headers=headers,params=body)
        r_json=r.json()
        print(r_json)

    def test_add_05(self,login_token):
        sessionId,userId=login_token

        url='http://10.59.9.18/small/user/verify/v1/addReceiveAddress'
        headers={
            'sessionId':str(sessionId),
            'userId':str(userId)
        }
        body={
            'realName':'张三',
            'phone': '',
            'address': '北京昌平',
            'zipCode': '101010',
        }
        r=requests.post(url=url,headers=headers,params=body)
        r_json=r.json()
        print(r_json)